package com.party.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.party.business.domain.KcType;
import com.party.business.mapper.KcTypeMapper;
import com.party.business.service.IKcTypeService;
import com.party.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 课程分类Service业务层处理
 *
 * @author ruoyi
 * @date 2025-01-03
 */
@Service
public class KcTypeServiceImpl extends ServiceImpl<KcTypeMapper, KcType>  implements IKcTypeService
{
    @Autowired
    private KcTypeMapper kcTypeMapper;

    /**
     * 查询课程分类
     *
     * @param id 课程分类主键
     * @return 课程分类
     */
    @Override
    public KcType selectKcTypeById(String id)
    {
        return kcTypeMapper.selectKcTypeById(id);
    }

    /**
     * 查询课程分类列表
     *
     * @param kcType 课程分类
     * @return 课程分类
     */
    @Override
    public List<KcType> selectKcTypeList(KcType kcType)
    {
        return kcTypeMapper.selectKcTypeList(kcType);
    }

    /**
     * 新增课程分类
     *
     * @param kcType 课程分类
     * @return 结果
     */
    @Override
    public int insertKcType(KcType kcType)
    {
                kcType.setCreateTime(DateUtils.getNowDate());
            return kcTypeMapper.insertKcType(kcType);
    }

    /**
     * 修改课程分类
     *
     * @param kcType 课程分类
     * @return 结果
     */
    @Override
    public int updateKcType(KcType kcType)
    {
                kcType.setUpdateTime(DateUtils.getNowDate());
        return kcTypeMapper.updateKcType(kcType);
    }

    /**
     * 批量删除课程分类
     *
     * @param ids 需要删除的课程分类主键
     * @return 结果
     */
    @Override
    public int deleteKcTypeByIds(String[] ids)
    {
        return kcTypeMapper.deleteKcTypeByIds(ids);
    }

    /**
     * 删除课程分类信息
     *
     * @param id 课程分类主键
     * @return 结果
     */
    @Override
    public int deleteKcTypeById(String id)
    {
        return kcTypeMapper.deleteKcTypeById(id);
    }
}
